home *** CD-ROM | disk | FTP | other *** search
- import java.awt.Graphics;
- import java.awt.Polygon;
- import java.awt.Rectangle;
- import java.io.DataInputStream;
- import java.io.IOException;
-
- final class ColUrl extends ColObj {
- protected Polygon m_poly;
- protected String m_url = new String();
- private int m_numPts;
- private float[] m_ptArryX;
- private float[] m_ptArryY;
- private ColGrph m_colGraphicObj;
- public ColObj m_linkObject;
- public Rectangle m_bounds = new Rectangle();
-
- public void draw(Graphics var1) {
- this.m_poly = new Polygon();
-
- for(int var2 = 0; var2 < this.m_numPts; ++var2) {
- this.m_poly.addPoint((int)((this.m_ptArryX[var2] + 0.5F - this.m_colGraphicObj.m_xOrg) * this.m_colGraphicObj.m_mag), (int)((this.m_ptArryY[var2] + 0.5F - this.m_colGraphicObj.m_yOrg) * this.m_colGraphicObj.m_mag));
- }
-
- }
-
- public int getType() {
- return 7;
- }
-
- public Rectangle getBounds() {
- return this.m_bounds;
- }
-
- public ColUrl(DataInputStream var1, ColGrph var2, Graphics var3) throws IOException {
- this.m_colGraphicObj = var2;
-
- for(short var4 = var1.readShort(); var4 > 0; var4 = (short)(var4 + -1)) {
- String var10001 = this.m_url;
- this.m_url = var10001 + (char)var1.readByte();
- }
-
- if (this.m_url.indexOf(":") < 0) {
- if (this.m_url.indexOf("..") > -1) {
- String var5;
- for(var5 = new String(this.m_colGraphicObj.m_appComp.m_cvFilePath.toString()); this.m_url.indexOf("..") > -1; var5 = var5.substring(0, var5.lastIndexOf("/") + 1)) {
- this.m_url = this.m_url.substring(this.m_url.indexOf("..") + 3);
- var5 = var5.substring(0, var5.lastIndexOf("/"));
- }
-
- this.m_url = var5 + this.m_url;
- } else {
- this.m_url = this.m_colGraphicObj.m_appComp.m_cvFilePath + this.m_url;
- }
- }
-
- this.m_numPts = var1.readInt();
- this.m_ptArryX = new float[this.m_numPts];
- this.m_ptArryY = new float[this.m_numPts];
-
- for(int var7 = 0; var7 < this.m_numPts; ++var7) {
- this.m_ptArryX[var7] = (float)var1.readInt() / 65536.0F;
- this.m_ptArryY[var7] = (float)var1.readInt() / 65536.0F;
- }
-
- this.draw(var3);
- this.m_bounds.x = this.m_poly.getBoundingBox().x;
- this.m_bounds.y = this.m_poly.getBoundingBox().y;
- this.m_bounds.width = this.m_poly.getBoundingBox().width;
- this.m_bounds.height = this.m_poly.getBoundingBox().height;
- }
- }
-